//
//  ViewController.m
//  IOS
//
//  Created by blue on 15-11-5.
//  Copyright (c) 2015年 HYD. All rights reserved.
//

#import "ViewController.h"
#import <QuartzCore/QuartzCore.h>
#import "TestViewController.h"

@interface ViewController ()
{
    UILabel * l;

}
@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    self.title =@"我的标题栏";
    
    self.view.backgroundColor = [UIColor redColor];
    l = [UILabel new];
    l.text =@"你好，苏叼！";
    [l sizeToFit];
    l.center = CGPointMake (self.view.frame.size.width/2.0,self.view.frame.size.height/2.0);
    l.textColor = [UIColor redColor];
    [self.view addSubview:l];
    
    
    UIButton * btn = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    btn.frame = CGRectMake(100, 100, 200, 44);
    [btn setTitle:@"按钮" forState:UIControlStateNormal];
    [btn setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];
    [btn addTarget:self action:@selector(onClick:) forControlEvents:UIControlEventTouchUpInside];
    
    [self.view addSubview:btn];
    }

-(void)onClick: (id)sender{
    
    
    TestViewController * con = [TestViewController new];
    [self.navigationController pushViewController:con animated:YES];
    
//    
//    UIView * line =[[UIView alloc]initWithFrame:CGRectMake(0, 200, 0, 6)];
//    line.backgroundColor = [UIColor brownColor];
//    line.clipsToBounds=YES;
//     [self.view addSubview:line];
//    
//    
//    UIView * line2 = [[UIView alloc]initWithFrame:CGRectMake(self.view.frame.size.width/2.0, 0, 6, 0)];
//    line2.backgroundColor = [UIColor purpleColor];
//    [self.view addSubview:line2];
//    
//    UIView * line3 = [[UIView alloc]initWithFrame:CGRectMake(self.view.frame.size.width/2.0, 0, 6, 0)];
//    line3.backgroundColor = [UIColor blackColor];
//    [self.view addSubview:line3];
//    

//
//    [UIView animateWithDuration:1.6 animations:^{
//        line .frame = CGRectMake(0, 200, self.view.frame.size.width, 6);
//        
//    
//    }completion:^(BOOL finish){
//        [UIView animateWithDuration:0.6 animations:^{
//            line.frame = CGRectMake(self.view.frame.size.width, 200, 0, 6);
//            line2.frame = CGRectMake(self.view.frame.size.width/2.0, 0, 3, self.view.frame.size.height);
//            //line3.frame = CGRectMake(self.view.frame.size.width/2.0, 0, 3, self.view.frame.size.height);
//
//        }completion:^(BOOL finish){
//            [UIView animateWithDuration:0.6 animations:^{
//                line2.frame = CGRectMake(self.view.frame.size.width/2.0, self.view.frame.size.height, 6, 0);
//          
//            }completion:^(BOOL finish){
//                [UIView animateWithDuration:0.6 animations:^{
//                    line3.frame = CGRectMake(self.view.frame.size.width/2.0, self.view.frame.size.height, 4, 0);
//                    
//
////            
////               }];
//
//              
//                
//            }];
//        
//       
//        }];
//    
//    }];
//   

}


//-(void )viewDidAppear:(BOOL)animated{
//    [super viewDidAppear:animated];
//    [UIView animateWithDuration:1.6 animations:^{
//        l.center = CGPointMake(self.view.frame.size.width/2.0, self.view.frame.size.height - 400 );
//    }];
//    
//
//}


- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
